/**
 * @Author wywinstonwy
 * @Date 2022/1/2 10:24 下午
 * @Description:
 */
import 'package:demo202112/utils/common_appbar.dart';
import "package:flutter/material.dart";
enum ConferenceItem { AddMember, LockConference, ModifyLayout, TurnoffAl }

class MyButtons1 extends StatelessWidget {
  const MyButtons1({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var selectItemValue = '北京';
    final List<DropdownMenuItem> items = [];
    final DropdownMenuItem item1 = DropdownMenuItem(
      child: Text('北京'), value: '北京',);
    final DropdownMenuItem item2 = DropdownMenuItem(
      child: Text('上海'), value: '上海',);
    final DropdownMenuItem item3 = DropdownMenuItem(
      child: Text('广州'), value: '广州',);
    final DropdownMenuItem item4 = DropdownMenuItem(
      child: Text('深圳'), value: '深圳',);
    items.add(item1);
    items.add(item2);
    items.add(item3);
    items.add(item4);

    return Scaffold(
      appBar: getAppBar('buttons'),
      body: ListView(
        children: [
          ElevatedButton(onPressed: _ontap, child: Text('ElevatedButton')),
          TextButton(onPressed: _ontap, child: Text('TextButton')),
          const BackButton(),
          const CloseButton(),
          // DropdownButton(items: items, onChanged: (value) {  },),
          FloatingActionButton(onPressed: _ontap),
          IconButton(onPressed: _ontap, icon: Icon(Icons.details,color: Colors.blue,)),
          MaterialButton(onPressed: _ontap),
          OutlinedButton(onPressed: _ontap, child: Text('OutlinedButton')),
          OutlinedButton.icon(onPressed: _ontap, icon: Icon(Icons.ac_unit), label: Text('OutlinedButton.icon')),
          PopupMenuButton(itemBuilder: (BuildContext context)=> //菜单项构造器
          <PopupMenuEntry<ConferenceItem>>[
          const PopupMenuItem<ConferenceItem>(
            //菜单项
            value: ConferenceItem.AddMember,
            child: Text('添加成员'),
          ),
          const PopupMenuItem<ConferenceItem>(
            value: ConferenceItem.LockConference,
            child: Text('锁定会议'),
          ),
          const PopupMenuItem<ConferenceItem>(
            value: ConferenceItem.ModifyLayout,
            child: Text('修改布局'),
          ),
          const PopupMenuItem<ConferenceItem>(
            value: ConferenceItem.TurnoffAl,
            child: Text('挂断所有'),
          ),
        ],),
          RawMaterialButton(onPressed: _ontap),
          TextSelectionToolbarTextButton(child: Text('TextSelectionToolbarTextButton'), padding: EdgeInsets.all(30)),
          BackButtonIcon(),
        ],
      ),
    );
  }

  _ontap(){
    print('点击button');
  }
}


